package lab02.test25;

import com.sun.org.apache.xpath.internal.SourceTree;

import java.util.Scanner;

public class Test25 {
    public static void main(String[] args) {
        while (true) {
            Scanner s = new Scanner(System.in);
            System.out.println("请输入被除数：");
            int y = s.nextInt();
            System.out.println("请输入除数：");
            int x = s.nextInt();

        try{
        System.out.println(y/x);//程序执行体（写容易出错的部分）
        }catch(ArithmeticException e){
            System.out.println("除数为零导致错误");
        }
        }
    }
}
